package com.appwoo.txtws.adapter;

import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.appwoo.txtws.bean.AutoSoftInfo;
import java.util.List;

public class GridViewAdapter extends BaseAdapter
{
  List<AutoSoftInfo> al = null;
  Context context;
  int i;
  private PackageManager pm;

  public GridViewAdapter(Context paramContext, List<AutoSoftInfo> paramList, int paramInt)
  {
    this.context = paramContext;
    this.al = paramList;
    this.i = paramInt;
    this.pm = paramContext.getPackageManager();
  }

  public int getCount()
  {
    return this.al.size();
  }

  public Object getItem(int paramInt)
  {
    return this.al.get(paramInt);
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    if (paramView == null)
      paramView = LayoutInflater.from(this.context).inflate(2130903110, null);
    AutoSoftInfo localAutoSoftInfo = (AutoSoftInfo)this.al.get(paramInt);
    ImageView localImageView = (ImageView)paramView.findViewById(2131493119);
    TextView localTextView = (TextView)paramView.findViewById(2131493122);
    if ((paramInt == 0) && (this.i == 0))
      localImageView.setBackgroundResource(2130838135);
    while (true)
    {
      localTextView.setText(((AutoSoftInfo)this.al.get(paramInt)).getAsname());
      return paramView;
      if ((paramInt == 1) && (this.i == 0))
      {
        localImageView.setBackgroundResource(2130837767);
      }
      else if ((paramInt == 2) && (this.i == 0))
      {
        localImageView.setBackgroundResource(2130837748);
      }
      else
      {
        try
        {
          this.pm.getApplicationInfo(((AutoSoftInfo)this.al.get(paramInt)).getAspkg(), 8192);
          if (!"com.huawei.android.ChinaTelecomCustomize".equals(((AutoSoftInfo)this.al.get(paramInt)).getAspkg()))
            break label221;
          localImageView.setImageDrawable(this.context.getResources().getDrawable(2130838080));
        }
        catch (PackageManager.NameNotFoundException localNameNotFoundException)
        {
          localNameNotFoundException.printStackTrace();
        }
        continue;
        label221: localImageView.setImageDrawable(this.pm.getActivityIcon(new ComponentName(localAutoSoftInfo.getAspkg(), localAutoSoftInfo.getActivityName())));
      }
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.adapter.GridViewAdapter
 * JD-Core Version:    0.6.2
 */